<!--考勤管理页-->
<template>
  <div style="height: 6vh;background-color:#fff;padding:10px 20px;">
    <el-menu mode="horizontal" router :default-active="$route.path">

      <el-menu-item index="/checking_set">班次设置</el-menu-item>
      <el-menu-item index="/checking_group">考勤组设置</el-menu-item>
      <el-menu-item index="/checking_vocation">假期设置</el-menu-item>
    </el-menu>
  </div>
  <!-- 假期列表 -->
  <el-card style="margin:20px;">
    <div style="display: flex;justify-content: space-between;">
      <el-form-item label="年份筛选：">
        <el-select placeholder="请选择" style="width: 220px;">
          <el-option label="2024" value="1"></el-option>
          <el-option label="2023" value="2"></el-option>
          <el-option label="2022" value="3"></el-option>
          <el-option label="2021" value="4"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="搜索：">
        <el-input placeholder="请输入内容" style="width: 220px;"></el-input>
      </el-form-item>
      <div>
        <el-button   @click="beforeAddVocation" type="primary"
                   >新增假期</el-button>
      </div>
    </div>
<!--    新增假期弹窗-->
    <el-dialog v-model="dialogVisible" :title="dialogTitle">
      <el-form label-width="80px" label-position="top">
            <el-form-item label="年份">
              <el-input placeholder="请输入内容" ></el-input>
            </el-form-item>
            <el-form-item label="假期名称">
              <el-input placeholder="请输入内容" ></el-input>
            </el-form-item>
        <el-form-item label="假期时间">
          <el-date-picker type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>
        </el-form-item>

      </el-form>
      <template #footer>
          <el-button @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </template>
    </el-dialog>
<!--    假期卡片-->
    <el-table>
      <el-table-column type="index" label="序号" width="80" align="center"/>
      <el-table-column prop="brand" label="年份" align="center"/>
      <el-table-column prop="license" label="假期名称" align="center"/>
      <el-table-column prop="license" label="假期时间" align="center"/>
      <el-table-column label="操作" align="center">
        <template #default="scope">
          <el-button link type="primary" size="small">编辑</el-button>
          <el-button link type="primary" size="small">删除</el-button>

        </template>
      </el-table-column>



    </el-table>
  </el-card>
</template>
<script setup>
import {ref} from "vue";

const dialogVisible = ref(false);
//定义变量控制dialog的标题
const dialogTitle = ref('新增假期');
const beforeAddVocation = () => {
  dialogVisible.value = true;
  dialogTitle.value = '新增假期';
  console.log(dialogTitle.value);
}


</script>